package com.zjzywl.iotSendthings.repository;

import java.util.List;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.zjzywl.iotSendthings.entity.JDWPBGMX;
import com.zjzywl.iotSendthings.entity.JDWPBGXX;



@Repository
public interface ProvideInformationRepository extends JpaRepository<JDWPBGXX,Integer> {
	//根据uuid提供送物人姓名和身份证和时间字段
	@Query(value="select u.swrxm,u.swrzjh ,u.sjc from JDWPBGXX u where u.uuid=:uuid order by bgrq desc limit 1  ",nativeQuery=true)
	List<String> findByIp(@Param("uuid") String uuid);
	
	@Query(value="select * from JDWPBGXX u  where u.uuid=:uuid order by bgrq desc limit 1  ",nativeQuery=true)
	JDWPBGXX findByUuid(@Param("uuid") String uuid);
	
	@Query("select u from JDWPBGXX u where u.bz is null")
	List<JDWPBGXX> findlist();
	@Query("select u from JDWPBGXX u where u.bz='ysp' order by bgrq desc")
	List<JDWPBGXX> findByBz();
	
}
